<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>产品管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../script/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="../script/moderate.js"></script>
</head>
<body>
<div class="container">
    <div class="flow">
        <div class="itemtitle">
            <h3>产品管理</h3>
            <ul>
                <li <{if $smarty.get.operation==''}>class="current"<{/if}>><a href="?m=<{$smarty.get.m}>&s=product.php"><span>所有产品</span></a></li>
                <li <{if $smarty.get.operation=='wait'}>class="current"<{/if}>><a href="?m=<{$smarty.get.m}>&s=product.php&operation=wait"><span>待审核</span></a></li>
                <li <{if $smarty.get.operation=='down'}>class="current"<{/if}>><a href="?m=<{$smarty.get.m}>&s=product.php&operation=down"><span>违规下架产品</span></a></li>
                <{if $smarty.get.operation=='edit'}>
                <li class="current"><a href="#"><span>修改</span></a></li>
                <{/if}>
            </ul>
        </div>
    </div>
    <div class="h35"></div>
    <{if $smarty.get.operation=='edit'}>
    <form id="form" method="post">
    <table class="table table1">
        <tr>
            <td width="80">状态</td>
            <td>
            <{foreach item=list key=key from=$status}>
            <{if $key}>
            <label><input type="radio" name="status" value="<{$key}>" /><{$list}></label>
            <{/if}>
            <{/foreach}>
            </td>
        </tr>
        <tr>
            <td>备注</td>
            <td><textarea name="note" class="w245"></textarea></td>
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td>
            <input class="submit" type="submit" value="提交">
            <input name="act" type="hidden" id="action" value="add">
            </td>
        </tr>
    </table>
    </form>
    <{else}>
    <table class="select_table">
        <tr>
            <td>
                <div class="select_box">
                    <form action="" method="get">
                    <input type="hidden" name="m" value="<{$smarty.get.m}>">
                    <input type="hidden" name="s" value="product.php">
                    <input placeholder="请输入产品名称..." type="text" name="name" class="txt s w250" value="<{$smarty.get.name}>"  />
                    <input placeholder="请输入店铺名称..." type="text" name="user" class="txt w150" value="<{$smarty.get.user}>"  />
                    <input type="submit" value="搜索" />
                    </form>
                </div>
                <a class="refresh" href="?m=<{$smarty.get.m}>&s=product.php"></a>
            </td>
        </tr>
    </table>
	<div style="position: relative;" id="threadlist">   
    <form action="" method="post" id="form" name="form">
    <input type="hidden" name="act" id="act" value="op" />
    <table class="table product">
        <tbody>
            <tr class="header">
                <th width="12"></th>
                <th width="30">操作</th>
                <th colspan="2" class="al">产品名称</th>
                <th width="100">销售价</th>
                <th width="100">库存</th>
                <th width="80">竟价排名</th>
                <th width="80">状态</th>
                <th width="80">浏览</th>
                <th width="80">更新时间</th>
            </tr>
            <{foreach item=list from=$de.list}>
            <tr>
                <td><input type="checkbox" value="<{$list.id}>" class="checkitem" onclick="tmodclick(this)" name="chk[]"></td>               
                <td>
                <a href="?s=cpmod.php&id=<{$list.id}>&<{$url}>"><{$editimg}></a>
                </td>
                <td class="al" width="80" valign="top"><a target="_blank" href="../?m=product&s=detail&id=<{$list.id}>"><img class="img" alt="<{$list.pname}>" src="<{$list.pic}>_60X60.jpg" /></a></td>
                <td class="al" valign="top">
                <h4><a target="_blank" href="../?m=product&s=detail&id=<{$list.id}>"><{$list.pname}></a></h4>
                
                <p>所属店铺：<{$list.company}></p>
                <p>所属分类：<{$list.catname}></p>
                <p>所属品牌：<{$list.brand}></p>
                </td>
                <td><{$config.money}> <{$list.price}></td>
                <td><{$list.amount}></td>
                <td><{$list.rank}></td>
                <td><{assign var=num value=$list.statu}><{$status.$num}></td>
                <td><{$list.read_nums}></td>
                <td><{$list.uptime|date_format:"%Y-%m-%d<br>%H:%M:%S"}></td>
            </tr>
            <{foreachelse}>
            <tr>
                <td class="norecord" colspan="99"><i></i><span>暂无符合条件的数据记录</span></td>
            </tr>
            <{/foreach}>
        </tbody>
        <tfoot>
            <tr>
                <td colspan="99" class="pages">
                <div class="fl">每页最多显示： 20条</div>
                <div class="page"><{$de.page}></div>
				<div class="fr">共有<{$de.count}>条记录</div>
                </td>
            </tr>
        </tfoot>
    </table>
    
    <div id="mdly" class="hidden">
        <a onclick="$('#mdly').addClass('cpd');" href="javascript:;" class="min">最小化</a>
        <label>
        <input type="checkbox" onclick="if(!($('.max')[0].innerHTML = modclickcount = checkall(this.form, 'chk'))) {$('#mdly').hide();}" name="chkall">
        全选
        </label>
        <h6>
            <span>选中</span>
            <strong class="max" onclick="$('#mdly').removeClass('cpd');">0</strong>
            <span>个产品: </span>
        </h6>
        <p>
            <a id="button" key="up" href="javascript:;"><b>可售</b></a>
            <span>|</span>
            <a id="button" key="down" href="javascript:;"><b>违规下架</b></a>
            <span>|</span>
            <a id="button" key="tj" href="javascript:;"><b>推荐</b></a>
        </p>
        <p>
           <!-- <a id="button" key="edit" href="javascript:;">编辑</a>
            <span>|</span>-->
            <a id="button" key="del" href="javascript:;">删除</a>
            
        </p>
    </div>
    </form>
	</div>
    <{/if}>
</div>
<script>
$("#button").live('click',function(){
    var key=$(this).attr("key")
	if(key=='edit')
	{
		window.location="module.php?m=product&s=product.php&operation=edit";
	}
	else
	{
		$("#act").val(key);		
		$("#form")[0].submit();
	}
	return false;
});
</script>    
</body>
</html>